/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.exam;

import org.jsoup.Jsoup;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: javaseapp - Ex2
 * <p>Powered by webrx On 2021-08-07 11:32:40
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ex3 {
    public static void main(String[] args) throws IOException {
        String u = "http://www.beiyouedu.com/a/aboout/contact/";
        String html = Jsoup.connect(u).get().toString();

        Pattern p = Pattern.compile("1\\d{10}");
        Matcher m = p.matcher(html);
        Set<String> set = new HashSet<String>();
        while (m.find()) {
            set.add(m.group());
        }
        System.out.println(set);
    }
}
